#include "ReflectiveMaterial.h"
#include "Integrator.h"

Color ReflectiveMaterial::shade(const Scene * scene, const Ray & ray, const IntersectResult &intersect, const TraceState & traceState) const {
	Vector3 r = reflect(ray.dir, intersect.normal);
	Color reflection = scene->getIntegrator()->Li(scene, Ray(intersect.position, r), traceState);
	reflection *= strength;
	return material ? reflection *= material->shade(scene, ray, intersect, traceState) : reflection;
}